Skip to content

Fix disableSandboxForPluginCommands #5855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

neonichu
Copy link
Contributor

This was broken in #5846 which accidentally used the default value instead of passing along the global option.

rdar://101681661

This was broken in #5846 which accidentally used the default value instead of passing along the global option.

rdar://101681661
@neonichu neonichu self-assigned this Oct 31, 2022
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

@swift-ci please test package compatibility

@@ -263,6 +263,7 @@ extension SwiftCommand {
additionalFileRules: FileRuleDescription.swiftpmFileTypes,
pluginScriptRunner: swiftTool.getPluginScriptRunner(),
pluginWorkDirectory: try swiftTool.getActiveWorkspace().location.pluginWorkingDirectory,
disableSandboxForPluginCommands: swiftTool.options.security.shouldDisableSandbox,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we missing a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's complicated™️

We have a test that's been added in #4283, but it didn't trigger here for two reasons:

  • We are running neither macOS 12 nor installing the concurrency compatibility libs on Swift CI, which leads to plugin tests being skipped on macOS and the sandboxing tests are macOS-only (rdar://100780895)
  • Build commands generated by plugins are running in a sandbox that currently has blanket approval for /private/tmp which also happens to be where we're placing test examples during test execution, so the sandbox is more open than normally during tests. Sandbox for manifests and plugins should provide a unique path specified by TMPDIR instead of allowing /tmp #4307 aims to address that by giving individual plugins unique temporary directories

Copy link
Contributor

@abertelrud abertelrud Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I have rebased that Sandbox TMPDIR PR and revived it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants